CREFERENCE_GTK = `pkg-config --cflags --libs gtk+-2.0`
CREFERENCE_MYSQL = `mysql_config --cflags --libs`
server:server_start.o mysql_deal_with.o socket_deal_with.o server_info.o
	gcc $^ -o $@  $(CREFERENCE_GTK) $(CREFERENCE_MYSQL)
	@if [ -d "./out/" ]; then \
		rm -r ./out/; \
	fi 
		mkdir ./out/; 
		mv *.o ./out/;
server_start.o:server_start.c
	gcc -c $^ $(CREFERENCE_GTK) $(CREFERENCE_MYSQL)

mysql_deal_with.o:mysql_deal_with.c
	gcc -c $^ $(CREFERENCE_GTK) $(CREFERENCE_MYSQL)

socket_deal_with.o:socket_deal_with.c
	gcc -c $^ $(CREFERENCE_GTK) $(CREFERENCE_MYSQL)
server_info.o:server_info.c
	gcc -c $^ $(CREFERENCE_GTK) $(CREFERENCE_MYSQL)

clean:
	rm -r ./out/
	rm -r server
